import { SetSpinningAction } from "../../store/afterLoanStore/action"

export const loanType = (type) => {
    switch (type) {
        case '1':
            return '个人信用'
        default:
            return '-'
    }
}

export const loanProduct = (product) => {
    switch (product) {
        case '1':
            return '工薪贷'
        case '2':
            return '悦薪贷'
        default:
            return '-'
    }
}

export const loanStage = (stage) => {
    switch (stage) {
        case '1':
            return '即将到期'
        case '2':
            return '已经逾期的贷款'
        default:
            return '-'
    }
}

export const loanPeriod = (period) => {
    switch (period) {
        case 1:
            return '每天一次'
        case 2:
            return '每天两次'
        default:
            return '-'
    }
}

export const clearSpin = (timer, dispatch) => {
    timer = setTimeout(() => {
        dispatch(SetSpinningAction(false))
        clearTimeout(timer)
    }, 1000)
}

